import {http} from "@/utils/http";
import {BaseResponse} from "@/model/BaseResponse";
import {QueryScoreDTO, QueryScoreStatusVO, VerifyCodeImageVO} from "@/model/score";

/**
 * 获取验证码
 * @param token
 * @constructor
 */
export const GetVerifyCodeImage = async (token: string) => {
  return await http.get<string, BaseResponse<VerifyCodeImageVO>>("/s/gvc?token=" + token);
};
/**
 * 检查查成绩的状态，是否已登录，是否有cookie，再检查缓存
 * @param token
 * @constructor
 */
export const CheckStatus = async (token: string) => {
  return await http.get<string, BaseResponse<QueryScoreStatusVO>>("/s/ct?token=" + token, );
};

/**
 * 获取成绩
 * @param dto
 * @param token
 * @constructor
 */
export const GetScore = async (dto: QueryScoreDTO ,token: string) => {
  return await http.post<QueryScoreDTO, BaseResponse<QueryScoreStatusVO>>("/s/gs?token=" + token, {
    data: dto,
  });
};
